package cc.eddic.practice.spring.domain;

import cc.eddic.practice.spring.jpa.BaseEntity;
import lombok.*;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import java.util.List;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name="t_question")
@Builder
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Question extends BaseEntity {
    private int no;
    private String description;
    private QuestionType questionType;
    private List<Option> options;


    public Question add(Option option) {
        option.setQuestion(this);
        options.add(option);
        return this;
    }






}
